Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve latest container id from cache when sending telemetry events #1628

Merged
merged 6 commits into from
Sep 19, 2019

Conversation

pgombar
Copy link
Contributor

@pgombar pgombar commented Sep 10, 2019

Description

Today, we populate a group of parameters called vminfo once at the start of the monitoring thread. One of these parameters is ContainerId which can change without redeploying the resource and restarting the agent (e.g. during live migration).

Adding the functionality to fetch the ContainerId parameter during the construction of the telemetry event from the process environment variables. The value is set during a goal state update.


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and Travis.CI is passing.

Quality of Code and Contribution Guidelines


This change is Reviewable

@codecov
Copy link

codecov bot commented Sep 10, 2019

Codecov Report

❗ No coverage uploaded for pull request base (develop@0105f5f). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #1628   +/-   ##
==========================================
  Coverage           ?   66.68%           
==========================================
  Files              ?       78           
  Lines              ?    11226           
  Branches           ?     1576           
==========================================
  Hits               ?     7486           
  Misses             ?     3412           
  Partials           ?      328
Impacted Files Coverage Δ
azurelinuxagent/ga/monitor.py 81.66% <ø> (ø)
azurelinuxagent/common/event.py 82.57% <100%> (ø)
azurelinuxagent/common/protocol/wire.py 74.88% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0105f5f...fe0f92a. Read the comment docs.

@pgombar pgombar changed the title Retrieve latest container id from goal state cache when sending telemetry events Retrieve latest container id from cache when sending telemetry events Sep 17, 2019
@@ -27,6 +27,12 @@
from azurelinuxagent.ga.exthandlers import *
from azurelinuxagent.common.protocol.wire import WireProtocol, InVMArtifactsProfile

SLEEP = time.sleep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I've been adding this to all my PRs ever since @larohra discovered this magical mock :) forgot to add a comment to this instance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor - Can you rename the var to MOCK_SLEEP? Only SLEEP felt like a boolean to me.

Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 minor suggestion else LGTM

Copy link
Contributor

@larohra larohra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pgombar pgombar merged commit 9687794 into Azure:develop Sep 19, 2019
@pgombar pgombar deleted the refresh_containerid branch September 19, 2019 20:43
pgombar added a commit to pgombar/WALinuxAgent that referenced this pull request Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants